Add Laya request preprocessing - #43
linear3735 wants to merge 5 commits into
Conversation
hsliuustc0106
left a comment
There was a problem hiding this comment.
Independent local review — Laya request preprocessing
Verdict: approved. Best-in-batch architecture conformance.
src/models/laya/src/preprocess.rs as a standalone processor module — token rows, option-marker positions, question types, usage counts, Laya 0.3.20 truncation rules, question/option order preserved — is precisely the processor placement the current contracts describe (prepare separate from execution). Tests live at repo-root tests/laya/ and the PR wires its test targets into ci.yml (the right pattern; see my #25 note). Locally at head 37736f08: laya suite passes with clippy -D warnings clean (25 passed / 3 checkpoint-gated ignored across the stack). CI green.
One rebase hazard flagged for the maintainer: this PR and #44 also modify cua_s1/native/src/json.rs (+44/-11) — the Python-compatible JSON module that has since moved to src/models/qwen3_5/native/src/json.rs and is contract-sensitive for Cua-S1. That hunk needs careful re-application against the moved module, with the cua_s1 JSON contract tests as the gate.
Approval per the repo review process; reflects head 37736f08 only.
|
fix conflcits |
Purpose
Pack English Laya requests into token rows, option-marker positions, question types and usage counts. Preserve question and option order and apply Laya 0.3.20's truncation rules.
#21 is merged. This PR adds preprocessing on top of that checkpoint layer: 496 core/configuration lines, excluding separate tests, docs and Cargo.lock. Refs #14.
Also preserve Cua-S1 JSON number parsing and Python float formatting when Laya enables
serde_json/arbitrary_precision. Without this fix, three existing Cua-S1 tests fail in the combined workspace.Fix private Number/RawValue key collisions in structured Laya inputs. Native callers now use
Request::from_json(&str)orRequest::from_value(Value); genericDeserializeis removed, while public fields andSerializeremain. New tests and helpers, including the Cua-S1 regression, live under repository-roottests/.Test Plan
Run workspace tests, fmt, strict Clippy and a release build. Compare packed inputs against the frozen 17-case Laya reference. Check private object keys, numeric preservation, request fields and JSON/value depth boundaries. Pinned inputs and commands are in the CPU packing recipe.
System1-Omni Version / Commit:
37736f0. Original preprocessing increment:219808b→99c1d12.Test Result
arbitrary_precision; the production parser is unchanged by the test relocation.CI for
37736f0: Rust CI, Docs build, benchmark harness tests passed.Self-review
Before marking this PR ready for review or requesting maintainer review, complete
the self-review checklist.
Keep the PR in draft while this work is incomplete.
For agent assistance, use the optional precheck-pr skill.